import jwt from "jsonwebtoken";

// TODO: Replace with your own secret key
const ACCESS_TOKEN_SECRET = "access_token_secret";
const REFRESH_TOKEN_SECRET = "refresh_token_secret";

export function generateAccessToken(user: any) {
  return jwt.sign(user, ACCESS_TOKEN_SECRET, { expiresIn: "7d" });
}

export function generateRefreshToken(user: any) {
  return jwt.sign(user, REFRESH_TOKEN_SECRET, {
    expiresIn: "30d",
  });
}
